import request from '@/request'

export function getAllTags() {
  return request({
    url: '/tags',
    method: 'get',
  })
}

export function getAllTagsDetail() {
  return request({
    url: '/tags/detail',
    method: 'get',
  })
}

export function getHotTags() {
  return request({
    url: '/tags/hot',
    method: 'get',
  })
}

export function getTag(id) {
  return request({
    url: `/tags/${id}`,
    method: 'get',
  })
}

export function getTagDetail(id) {
  return request({
    url: `/tags/detail/${id}`,
    method: 'get',
  })
}



export function tagAll(query) {
    return request({
      url: '/tags/tagAll',
      method: 'post',
      data: {
        pageNo: query.pageNo,
        pageSize: query.pageSize,
        tagName: query.tagName,
        description: query.description,
      },
    })
}

export function deletetagById(id) {
    return request({
      url: `/tags/deletetagById/${id}`,
      method: 'post',
    })
  }

export function updateTag(tag) {
    return request({
      url: '/tags/updateTag',
      method: 'post',
      data: tag,
    })
}

export function addTag(tag) {
    return request({
      url: '/tags/addTag',
      method: 'post',
      data: tag,
    })
}


